﻿@{
    Layout = null;
    ViewBag.Title = "编辑用户——公路工程建设项目造价全过程管理系统";
}
@model DotNet.Model.MyEntity.Base_User
<script type="text/javascript">
    $(document).ready(function () {
        $("#Permission_User_Edited").submit(function () {
            return false;
        });
        //$("#DutyOrderName").attr("","");
        $("#DutyOrderName").val($("#DutyOrderId").find("option:selected").text());
        $("#DutyOrderId").change(function () {
            $("#DutyOrderName").val($(this).find("option:selected").text());
        });
    });

    function selectRole() {
        //弹出角色选择框
        $.pdialog.open("/Permission/Role/SelectRole/" + $("#UserName").val(), "rel_Permission_Role_SelectRole", "选择角色", { "width": "300", "height": "360", "mask": "true" });
    }
   
</script>
<script src="@Url.Content("/Scripts/jQuery/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("/Scripts/jQuery/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div class="pageContentD">
    @{Html.EnableClientValidation();}
    @using (Html.BeginForm("UserEdited", "User", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,dialogEdited);", @id = "Permission_User_Edited", @class = "pageForm" }))
    { 
        <div class="pageFormContent" layouth="60">
            @Html.Raw(Model == null || Model.Id == null ? "" : "<input type=\"hidden\" value=\"" + Model.Id + "\" id=\"Id\" name=\"Id\" />")
            <table width="95%" class="tab01 tabNo">
                <tr>
                    <td class="td1" style="width: 25%;">
                        用户名：
                    </td>
                    <td>
                        @Model.UserName
                        @Html.HiddenFor(m => m.UserName, new Dictionary<string, object> { { "class", "input02" } })
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        姓名：
                    </td>
                    <td>
                        @Html.Raw(Model == null || Model.Id == null ? "" : "<input type=\"hidden\" value=\"" + Model.Id + "\" id=\"Id\" name=\"Id\" />")
                        @Html.TextBoxFor(m => m.RealName, new Dictionary<string, object> { { "alt", "请输入姓名" }, { "class", "input02" } })
                        @Html.ValidationMessageFor(m => m.RealName)
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        编号：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.Code, new Dictionary<string, object> { { "class", "input02" } })
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        排序：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.SortCode, new Dictionary<string, object> { { "class", "input02" } })
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        角色：
                    </td>
                    <td>
                        <input type="hidden" id="roleIDs_Permission_User_CreateUser" name="roleIDs" value="@ViewData["roleListID"]" />
                        <input id="roleNames_Permission_User_CreateUser" class="input02 textInput" name="roleNames" type="text" value="@ViewBag.RoleNames" disabled="disabled" readonly="readonly" />
                        <a class="btnLook" href="javascript:selectRole();"><span>选择</span></a>
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        职称：
                    </td>
                    <td>
                        @Html.DropDownListFor(m => m.Title, new SelectList(ViewBag.Titles as System.Collections.IEnumerable, "ItemValue", "ItemName"), "--请选择职称--")
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        岗位序列：
                    </td>
                    <td>
                        @Html.HiddenFor(m => m.DutyOrderName)
                        @Html.DropDownListFor(m => m.DutyOrderId, new SelectList(ViewBag.DutyList as System.Collections.IEnumerable, "ID", "ItemName"), "--请选择岗位序列--")
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        电子邮件：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.Email, new Dictionary<string, object> { { "class", "input02" } })
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        手机：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.Mobile, new Dictionary<string, object> { { "class", "input02" } })
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        QQ：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.OICQ, new Dictionary<string, object> { { "class", "input02" } })
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                        地址：
                    </td>
                    <td>
                        @Html.TextAreaFor(m => m.HomeAddress, new Dictionary<string, object> { { "class", "input02" } })
                        @Html.ValidationMessageFor(m => m.HomeAddress)
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                    </td>
                    <td>
                        <input type="checkbox" name="Enabled" id="Enabled" value="1"  @Html.Raw(Model == null || Model.Enabled == null ? "checked='checked'" : (Model.Enabled == 1 ? "checked='checked'" : "")) />有效
                    </td>
                </tr>
            </table>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <button type="submit" class="btn btn-success btn-sm">
                        保存</button>
                </li>
                <li>
                    <button type="button" class="close btn btn-default btn-sm">
                        取消</button>
                </li>
            </ul>
        </div>
    }
</div>
